using DapperExtensions.Mapper;

namespace Read.Models
{
    /// <summary>
    /// 字段映射
    /// </summary>
    public class AccessMapper : ClassMapper<AccessModel>
    {
        public AccessMapper()
        {
            Table(Tables.Access);
            Map(c => c.RoleId).Column("RoleId");
            Map(c => c.NodeId).Column("NodeId");
            Map(c => c.Level).Column("Level");
            Map(c => c.Pid).Column("Pid");
            Map(c => c.Module).Column("Module");
        }
    }

    /// <summary>
    /// 权限类
    /// </summary>
    public class AccessModel
    {
        /// <summary>
        /// 角色Id
        /// </summary>
        public int RoleId { get; set; }

        /// <summary>
        /// 节点Id
        /// </summary>
        public int NodeId { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// Pid
        /// </summary>
        public int Pid { get; set; }

        /// <summary>
        /// Module
        /// </summary>
        public string Module { get; set; }
    }
}